﻿using DataBase;
using DataBase.DBmodels;
using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using static GreenXi.Help.UI.MultiComboBox;

namespace GreenXi.Model
{
    public class ProductionModel : BindableBase
    {

        #region 操作
        public DelegateCommand<object> DetailColumn { get; set; } //明细

        public DelegateCommand<object> ViewCurve { get; set; } //明细

        public DelegateCommand<object> SelectColumn { get; set; } //查询
        public DelegateCommand<object> ExportData { get; set; } //导出数据
        public DelegateCommand ViewCurvesByFile { get; set; } //通过文件查看曲线

        public DelegateCommand<object> SelectFilter { get; set; }
        #endregion

        #region 表格
        private List<ProductionData> _ProductionList;
        public List<ProductionData> ProductionList
        {
            get => _ProductionList;
            set
            {
                SetProperty(ref _ProductionList, value);
            }
        }
        


        private ObservableCollection<Region> _RegionList;
        public ObservableCollection<Region> RegionList
        {
            get => _RegionList;
            set
            {
                SetProperty(ref _RegionList, value);
            }
        }

        private ObservableCollection<Electricity> _ProductionLogList;
        public ObservableCollection<Electricity> ProductionLogList
        {
            get => _ProductionLogList;
            set
            {
                SetProperty(ref _ProductionLogList, value);
            }
        }

        ////数据绑定
        public List<ProductionData> _oPDate;
        public List<ProductionData> OPDate
        {
            get { return _oPDate; }
            set { SetProperty(ref _oPDate, value); RaisePropertyChanged("OPDate"); }
        }

        #endregion

        #region 搜索条件
        /// <summary>
        /// SN
        /// </summary>
        private int? _CraftId;

        public int? CraftId
        {
            get => _CraftId;
            set { SetProperty(ref _CraftId, value); }
        }

        /// <summary>
        /// 压机号
        /// </summary>
        private string? _CylinderNo;

        public string? CylinderNo
        {
            get => _CylinderNo;
            set { SetProperty(ref _CylinderNo, value); }
        }


        /// <summary>
        /// 开始时间
        /// </summary>
        private DateTime? _StartTime;
        public DateTime? StartTime
        {
            get => _StartTime == null ? DateTime.Now.AddMonths(-1) : _StartTime;
            set { SetProperty(ref _StartTime, value); }
        }

        /// <summary>
        /// 开始时间
        /// </summary>
        private DateTime? _EndTime;
        public DateTime? EndTime
        {
            get => _EndTime == null ? DateTime.Now.AddMonths(1) : _EndTime;
            set { SetProperty(ref _EndTime, value); }
        }
        #endregion


        #region 产品下拉框

        private ObservableCollection<CraftView>? _CraftList;
        public ObservableCollection<CraftView>? CraftList
        {
            get => _CraftList;
            set
            {
                _CraftList = value;
            }
        }
        #endregion

        private ObservableCollection<MultiCbxBaseData>? _Multi;
        public ObservableCollection<MultiCbxBaseData>? Multi
        {
            get => _Multi;
            set
            {
                _Multi = value;
            }
        }
        



    }
}
